﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Admin.Master" Inherits="System.Web.Mvc.ViewPage<ThietBiSo.LinQDB.Slider>" %>

<%@ Import Namespace="ThietBiSo.LinQDB" %>
<%@ Import Namespace="ThietBiSo.Models" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Website - bảng điều khiển
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <script type="text/javascript">
        function submitForm() {
            var F = document.forms[0];

            document.forms[0].submit();
        } 
    </script>
    <%
   
        MSlider mlsp = new MSlider();
        var loaisp = mlsp.FindAll();
    %>
    <% using (Html.BeginForm("Create", "slide", FormMethod.Post, new { @enctype = "multipart/form-data" }))
       { %>
    <%: Html.ValidationSummary(true) %>
    <fieldset>
        <legend class="classFieldSet">Thêm mới slider</legend>
        <table width="100%">
            <tr>
                <td class="classCreate">
                    <input type="button" value="Thêm" class="btn" onclick="submitForm();" />
                </td>
                <td class="classBack">
                    <%: Html.ActionLink("Quay lại", "Index",null,new { @class = "classThem" })%>
                </td>
            </tr>
            <tr>
                <td class="tableLabel">
                    Hình ảnh
                </td>
                <td class="tableField">
                    <%:Html.TextBox("HinhAnh")%>
                    <input type="button" value="Chọn ..." id="btnSelectImg" name="btnSelectImg" />
                    <script type="text/javascript">
                        $(document).ready(function () {
                            $("#btnSelectImg").click(function () {
                                var finder = new CKFinder();
                                finder.selectActionFunction = function (fileUrl) {
                                    $('#HinhAnh').val(fileUrl);
                                };
                                finder.popup();
                            });
                        });
                    </script>
                    <div style="color: Red">
                        Kích thước hình: (1000 x 200) là tốt nhất, Có đuôi (*.jpg, *.jpeg, *.gif)</div>
                    <%-- <input class="field" type="file" name="fileUpload" id="fileUpload" style="width: 100%;" />--%>
                </td>
            </tr>
        </table>
    </fieldset>
    <% } %>
</asp:Content>
